using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using FarseerPhysics.Dynamics;
using FarseerPhysics.Common;
using FarseerPhysics.Collision.Shapes;
using FarseerPhysics.Factories;
using FarseerPhysics;
using chemicall.data;

namespace chemicall
{
    /// <summary>
    /// This is the main type for your game
    /// </summary>
    public class Game1 : Microsoft.Xna.Framework.Game
    {
        public GraphicsDeviceManager graphics;
        public SpriteBatch spriteBatch;
        public ScreenManager screenManager;
        public EntityDescription entity;
        public SoundManager soundMan;

        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";
            soundMan = SoundManager.getInstance();
            initSounds();
            screenManager = new ScreenManager(this);
            Components.Add(screenManager);
            AddInitialScreens();
        }

        private void AddInitialScreens()
        {
            screenManager.AddScreen(new MainMenuScreen(), PlayerIndex.One);
        }
        private void initSounds()
        {
            soundMan.initEvent(CONSTANTES.JUMP_SOUND_ID, "chemicallSP/FX/jump");
            soundMan.initEvent(CONSTANTES.MENU_SOUND_ID, "chemicallSP/FX/cursor");
            soundMan.initEvent(CONSTANTES.PERTE_SOUND_ID, "chemicallSP/FX/loseElec");
            soundMan.initEvent(CONSTANTES.GAIN_SOUND_ID, "chemicallSP/FX/gainElec");
            soundMan.initEvent(CONSTANTES.INGAME_MUSIC_ID, "chemicallSP/Music/SpacialTheme");
            soundMan.initEvent(CONSTANTES.MENU_MUSIC_ID, "chemicallSP/Music/CaveTheme");
            soundMan.initEvent(CONSTANTES.BUBBLE_TIP_ID, "chemicallSP/FX/bubbleTip");
            soundMan.initEvent(CONSTANTES.GAME_OVER_ID, "chemicallSP/FX/gameOver");

        }


        protected override void Draw(GameTime gameTime)
        {
            graphics.GraphicsDevice.Clear(Color.Black);

            // The real drawing happens inside the screen manager component.
            base.Draw(gameTime);
        }
    }
}
